Fix some issues with background drawing in RTL. (#318781, Eric Cazeaux)
authorMatthias Clasen <mclasen@redhat.com>
Wed, 26 Oct 2005 04:23:46 +0000 (04:23 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 26 Oct 2005 04:23:46 +0000 (04:23 +0000)
2005-10-25  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
        Fix some issues with background drawing in RTL.  (#318781,
        Eric Cazeaux)

ChangeLog
ChangeLog.pre-2-10
gtk/gtktreeviewcolumn.c

index cb6538c177b898a6eb3f0de261f69ef09ab3febc..a2ce65a7fde5a12f8fc1b3783f4a9d16610cee90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-10-25  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
+       Fix some issues with background drawing in RTL.  (#318781,
+       Eric Cazeaux)
+
        * tests/Makefile.am:
        * tests/testentrycompletion.c: Apply a patch by Christian
        Persch to add property editors.
index cb6538c177b898a6eb3f0de261f69ef09ab3febc..a2ce65a7fde5a12f8fc1b3783f4a9d16610cee90 100644 (file)
@@ -1,5 +1,9 @@
 2005-10-25  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
+       Fix some issues with background drawing in RTL.  (#318781,
+       Eric Cazeaux)
+
        * tests/Makefile.am:
        * tests/testentrycompletion.c: Apply a patch by Christian
        Persch to add property editors.
index c1867a7abbf4d6f60327fe903093b20ad19a35a1..31d57b278e373f31f9e4b8d9f1611063c1992c81 100644 (file)
@@ -2706,7 +2706,11 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn  *tree_column,
   real_cell_area = *cell_area;
   real_background_area = *background_area;
 
-  depth = real_cell_area.x - real_background_area.x - horizontal_separator/2;
+
+  if (rtl)
+    depth = real_background_area.width - real_cell_area.width - horizontal_separator/2;
+  else
+    depth = real_cell_area.x - real_background_area.x - horizontal_separator/2;
 
   real_cell_area.x += focus_line_width;
   real_cell_area.y += focus_line_width;
@@ -2761,7 +2765,16 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn  *tree_column,
 
       real_cell_area.width = info->real_width;
       real_cell_area.width -= 2 * focus_line_width;
-      real_background_area.width = info->real_width + horizontal_separator + depth;
+
+      if (list->next)
+       {
+         real_background_area.width = info->real_width + horizontal_separator + depth ;
+       }
+      else
+       {
+          /* fill the rest of background for the last cell */
+         real_background_area.width = background_area->x + background_area->width - real_background_area.x;
+       }
 
       rtl_cell_area = real_cell_area;
       rtl_background_area = real_background_area;
@@ -2893,7 +2906,10 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn  *tree_column,
       flags &= ~GTK_CELL_RENDERER_FOCUSED;
 
       real_cell_area.x += (real_cell_area.width + tree_column->spacing);
-      real_background_area.x += (real_background_area.width + tree_column->spacing);
+      real_background_area.x += (real_background_area.width + tree_column->spacing - (2 * focus_line_width ));
+
+      /* Only needed for first cell */
+      depth=0;
     }
 
   /* iterate list for PACK_END cells */